//
//  LKSheetOptionViewController.h
//  SheetOptionViewController
//
//  Created by LIUKUN-PC on 16/5/4.
//  Copyright © 2016年 liukun. All rights reserved.
//

//从底部弹出选项视图

/*  跳转需采用Modal， Animation为NO， 示例如下
 *
 *  LKSheetOptionViewController *sheetOptionView = [LKSheetOptionViewController initWithOptionsArray:@[@"修改", @"删除"] didSelectOptionHandler:^(NSInteger index) {
        NSLog(@"%ld", index)
 }];
    [self presentViewController:optionSheetVC animated:NO completion:nil];
 *
 */

#import <UIKit/UIKit.h>

@class LKOptionSheetViewController;

@protocol LKOptionSheetViewControllerDelegate <NSObject>

@optional

- (void)optionSheetViewController:(LKOptionSheetViewController *)optionSheetViewController didSelectOptionAtIndex:(NSInteger)index;

@end

@interface LKOptionSheetViewController : UIViewController

/** 标题,提示信息 */
@property (nonatomic, strong) NSString *titleStr;

/** 操作选项字符串数组 */
@property (nonatomic, strong) NSArray<NSString *> *optionsArray;

/** 删除 选项 是否为红色，默认为YES */
@property (nonatomic, assign) BOOL isDelectOptionRed;

/** 红色按钮索引, 默认为-1 */
@property (nonatomic, assign) NSInteger redIndex;
/** 取消的回调 */
@property (nonatomic, copy) void(^cancelBlock)();

/** 代理属性 */
@property (nonatomic, weak) id<LKOptionSheetViewControllerDelegate> delegate;

/**
 *  操作选项的Block回调
 *
 *  @param didSelectOptionBlock 回调Block，参数index为选项所在的索引
 */
- (void)didSelectOptionHandler:(void(^)(NSInteger index))didSelectOptionBlock;

/**
 *  初始化方法
 *
 *  @param optionsArray         操作选项字符串数组
 *  @param didSelectOptionBlock 操作选项的Block回调
 *
 *  @return 实例对象
 */
- (instancetype)initWithOptionsArray:(NSArray<NSString *> *)optionsArray didSelectOptionHandler:(void(^)(NSInteger index))didSelectOptionBlock;

@end
